package cn.hallele.bbts.core.component.io;

import jakarta.validation.Valid;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;

/**
 * PageDataDTO
 *
 * @author anle5
 * @since 2023/12/10 星期日 19:34
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class BBTSPage<T> implements Serializable {
    @Serial
    private static final long serialVersionUID = -3377581672342778019L;

    /**
     * 页码
     */
    @Min(1)
    @NotNull
    private Integer pageNo;

    /**
     * 每页数量
     */
    @Min(1)
    @NotNull
    private Integer pageSize;

    /**
     * 总数
     */
    private Long totalNum;

    /**
     *
     */
    private Integer totalPages;

    /**
     * 响应体
     */
    @Valid
    private T body;
}
